home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Script.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  31.5 KB  |  910 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Script.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __SCRIPT__
  13. #define __SCRIPT__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __QUICKDRAW__
  20. #include <Quickdraw.h>
  21. #endif
  22.  
  23. #ifndef __INTLRESOURCES__
  24. #include <IntlResources.h>
  25. #endif
  26.  
  27.  
  28. enum {
  29.  
  30.  
  31. /* Script System constants */
  32.  smSystemScript = -1,                /*designates system script.*/
  33.  smCurrentScript = -2,                /*designates current font script.*/
  34.  smAllScripts = -3,                    /*designates any script    <39>*/
  35.  
  36.  smRoman = 0,                        /*Roman*/
  37.  smJapanese = 1,                    /*Japanese*/
  38.  smTradChinese = 2,                    /*Traditional Chinese*/
  39.  smKorean = 3,                        /*Korean*/
  40.  smArabic = 4,                        /*Arabic*/
  41.  smHebrew = 5,                        /*Hebrew*/
  42.  smGreek = 6,                        /*Greek*/
  43.  smCyrillic = 7,                    /*Cyrillic*/
  44.  smRSymbol = 8,                        /*Right-left symbol*/
  45.  smDevanagari = 9,                    /*Devanagari*/
  46.  smGurmukhi = 10,                    /*Gurmukhi*/
  47.  smGujarati = 11,                    /*Gujarati*/
  48.  smOriya = 12,                        /*Oriya*/
  49.  smBengali = 13,                    /*Bengali*/
  50.  smTamil = 14,                        /*Tamil*/
  51.  smTelugu = 15,                        /*Telugu*/
  52.  smKannada = 16,                    /*Kannada/Kanarese*/
  53.  smMalayalam = 17                    /*Malayalam*/
  54. };
  55. enum {
  56.  smSinhalese = 18,                    /*Sinhalese*/
  57.  smBurmese = 19,                    /*Burmese*/
  58.  smKhmer = 20,                        /*Khmer/Cambodian*/
  59.  smThai = 21,                        /*Thai*/
  60.  smLaotian = 22,                    /*Laotian*/
  61.  smGeorgian = 23,                    /*Georgian*/
  62.  smArmenian = 24,                    /*Armenian*/
  63.  smSimpChinese = 25,                /*Simplified Chinese*/
  64.  smTibetan = 26,                    /*Tibetan*/
  65.  smMongolian = 27,                    /*Mongolian*/
  66.  smGeez = 28,                        /*Geez/Ethiopic*/
  67.  smEthiopic = 28,                    /*Synonym for smGeez*/
  68.  smEastEurRoman = 29,                /*Synonym for smSlavic*/
  69.  smVietnamese = 30,                    /*Vietnamese*/
  70.  smExtArabic = 31,                    /*extended Arabic*/
  71.  smUninterp = 32,                    /*uninterpreted symbols, e.g. palette symbols*/
  72.  smKlingon = 32,                    /*Klingon*/                                        /*<45>*/
  73.  
  74. /*Obsolete names for script systems (kept for backward compatibility)*/
  75.  smChinese = 2,                        /*(use smTradChinese or smSimpChinese)*/
  76.  smRussian = 7,                        /*(old name for smCyrillic)*/
  77.  
  78. /* smMaldivian = 25;         (no more smMaldivian!)*/
  79.  smAmharic = 28,                    /*(old name for smGeez)*/
  80.  smSlavic = 29                        /*(old name for smEastEurRoman)*/
  81. };
  82. enum {
  83.  smSindhi = 31,                        /*(old name for smExtArabic)*/
  84.  
  85.  
  86. /* Language Codes */
  87.  langEnglish = 0,            /* smRoman script */
  88.  langFrench = 1,            /* smRoman script */
  89.  langGerman = 2,            /* smRoman script */
  90.  langItalian = 3,            /* smRoman script */
  91.  langDutch = 4,                /* smRoman script */
  92.  langSwedish = 5,            /* smRoman script */
  93.  langSpanish = 6,            /* smRoman script */
  94.  langDanish = 7,            /* smRoman script */
  95.  langPortuguese = 8,        /* smRoman script */
  96.  langNorwegian = 9,            /* smRoman script */
  97.  langHebrew = 10,            /* smHebrew script */
  98.  langJapanese = 11,            /* smJapanese script */
  99.  langArabic = 12,            /* smArabic script */
  100.  langFinnish = 13,            /* smRoman script */
  101.  langGreek = 14,            /* smGreek script */
  102.  langIcelandic = 15,        /* extended Roman script */
  103.  langMaltese = 16,            /* extended Roman script */
  104.  langTurkish = 17,            /* extended Roman script */
  105.  langCroatian = 18,            /* Serbo-Croatian in extended Roman script */
  106.  langTradChinese = 19        /* Chinese in traditional characters */
  107. };
  108. enum {
  109.  langUrdu = 20,                /* smArabic script */
  110.  langHindi = 21,            /* smDevanagari script */
  111.  langThai = 22,                /* smThai script */
  112.  langKorean = 23,            /* smKorean script */
  113.  langLithuanian = 24,        /* smEastEurRoman script */
  114.  langPolish = 25,            /* smEastEurRoman script */
  115.  langHungarian = 26,        /* smEastEurRoman script */
  116.  langEstonian = 27,            /* smEastEurRoman script */
  117.  langLettish = 28,            /* smEastEurRoman script */
  118.  langLatvian = 28,            /* Synonym for langLettish */
  119.  langLapponian = 29,        /* extended Roman script */
  120.  langLappish = 29,            /* Synonym for langLapponian */
  121.  langFaeroese = 30,            /* smRoman script */
  122.  langFarsi = 31,            /* smArabic script */
  123.  langPersian = 31,            /* Synonym for langFarsi */
  124.  langRussian = 32,            /* smCyrillic script */
  125.  langSimpChinese = 33,        /* Chinese in simplified characters */
  126.  langFlemish = 34,            /* smRoman script */
  127.  langIrish = 35,            /* smRoman script */
  128.  langAlbanian = 36            /* smRoman script */
  129. };
  130. enum {
  131.  langRomanian = 37,            /* smEastEurRoman script */
  132.  langCzech = 38,            /* smEastEurRoman script */
  133.  langSlovak = 39,            /* smEastEurRoman script */
  134.  langSlovenian = 40,        /* smEastEurRoman script */
  135.  langYiddish = 41,            /* smHebrew script */
  136.  langSerbian = 42,            /* Serbo-Croatian in smCyrillic script */
  137.  langMacedonian = 43,        /* smCyrillic script */
  138.  langBulgarian = 44,        /* smCyrillic script */
  139.  langUkrainian = 45,        /* smCyrillic script */
  140.  langByelorussian = 46,        /* smCyrillic script */
  141.  langUzbek = 47,            /* smCyrillic script */
  142.  langKazakh = 48,            /* smCyrillic script */
  143.  langAzerbaijani = 49,        /* Azerbaijani in smCyrillic script (USSR) */
  144.  langAzerbaijanAr = 50,        /* Azerbaijani in smArabic script (Iran) */
  145.  langArmenian = 51,            /* smArmenian script */
  146.  langGeorgian = 52,            /* smGeorgian script */
  147.  langMoldavian = 53,        /* smCyrillic script */
  148.  langKirghiz = 54,            /* smCyrillic script */
  149.  langTajiki = 55,            /* smCyrillic script */
  150.  langTurkmen = 56            /* smCyrillic script */
  151. };
  152. enum {
  153.  langMongolian = 57,        /* Mongolian in smMongolian script */
  154.  langMongolianCyr = 58,        /* Mongolian in smCyrillic script */
  155.  langPashto = 59,            /* smArabic script */
  156.  langKurdish = 60,            /* smArabic script */
  157.  langKashmiri = 61,            /* smArabic script */
  158.  langSindhi = 62,            /* smExtArabic script */
  159.  langTibetan = 63,            /* smTibetan script */
  160.  langNepali = 64,            /* smDevanagari script */
  161.  langSanskrit = 65,            /* smDevanagari script */
  162.  langMarathi = 66,            /* smDevanagari script */
  163.  langBengali = 67,            /* smBengali script */
  164.  langAssamese = 68,            /* smBengali script */
  165.  langGujarati = 69,            /* smGujarati script */
  166.  langPunjabi = 70,            /* smGurmukhi script */
  167.  langOriya = 71,            /* smOriya script */
  168.  langMalayalam = 72,        /* smMalayalam script */
  169.  langKannada = 73,            /* smKannada script */
  170.  langTamil = 74,            /* smTamil script */
  171.  langTelugu = 75,            /* smTelugu script */
  172.  langSinhalese = 76            /* smSinhalese script */
  173. };
  174. enum {
  175.  langBurmese = 77,            /* smBurmese script */
  176.  langKhmer = 78,            /* smKhmer script */
  177.  langLao = 79,                /* smLaotian script */
  178.  langVietnamese = 80,        /* smVietnamese script */
  179.  langIndonesian = 81,        /* smRoman script */
  180.  langTagalog = 82,            /* smRoman script */
  181.  langMalayRoman = 83,        /* Malay in smRoman script */
  182.  langMalayArabic = 84,        /* Malay in smArabic script */
  183.  langAmharic = 85,            /* smEthiopic script */
  184.  langTigrinya = 86,            /* smEthiopic script */
  185.  langGalla = 87,            /* smEthiopic script */
  186.  langOromo = 87,            /* Synonym for langGalla */
  187.  langSomali = 88,            /* smRoman script */
  188.  langSwahili = 89,            /* smRoman script */
  189.  langRuanda = 90,            /* smRoman script */
  190.  langRundi = 91,            /* smRoman script */
  191.  langChewa = 92,            /* smRoman script */
  192.  langMalagasy = 93,            /* smRoman script */
  193.  langEsperanto = 94,        /* extended Roman script */
  194.  langWelsh = 128            /* smRoman script */
  195. };
  196. enum {
  197.  langBasque = 129,            /* smRoman script */
  198.  langCatalan = 130,            /* smRoman script */
  199.  langLatin = 131,            /* smRoman script */
  200.  langQuechua = 132,            /* smRoman script */
  201.  langGuarani = 133,            /* smRoman script */
  202.  langAymara = 134,            /* smRoman script */
  203.  langTatar = 135,            /* smCyrillic script */
  204.  langUighur = 136,            /* smArabic script */
  205.  langDzongkha = 137,        /* (lang of Bhutan) smTibetan script */
  206.  langJavaneseRom = 138,        /* Javanese in smRoman script */
  207.  langSundaneseRom = 139,    /* Sundanese in smRoman script */
  208.  
  209. /* Obsolete names, kept for backward compatibility */
  210.  langPortugese = 8,            /* old misspelled version, kept for compatibility */
  211.  langMalta = 16,            /* old misspelled version, kept for compatibility */
  212.  langYugoslavian = 18,        /* (use langCroatian, langSerbian, etc.) */
  213.  langChinese = 19            /* (use langTradChinese or langSimpChinese) */
  214. };
  215.  
  216.  
  217. enum {
  218. /* Regional version codes */
  219.  verUS = 0,
  220.  verFrance = 1,
  221.  verBritain = 2,
  222.  verGermany = 3,
  223.  verItaly = 4,
  224.  verNetherlands = 5,
  225.  verFrBelgiumLux = 6,            /* French for Belgium & Luxembourg */
  226.  verSweden = 7,
  227.  verSpain = 8,
  228.  verDenmark = 9,
  229.  verPortugal = 10,
  230.  verFrCanada = 11,
  231.  verNorway = 12
  232. };
  233. enum {
  234.  verIsrael = 13,
  235.  verJapan = 14,
  236.  verAustralia = 15,
  237.  verArabic = 16,                /* synonym for verArabia */
  238.  verFinland = 17,
  239.  verFrSwiss = 18,                /* French Swiss */
  240.  verGrSwiss = 19,                /* German Swiss */
  241.  verGreece = 20,
  242.  verIceland = 21,
  243.  verMalta = 22,
  244.  verCyprus = 23,
  245.  verTurkey = 24,
  246.  verYugoCroatian = 25,            /* Croatian system for Yugoslavia */
  247.  verIndiaHindi = 33,            /* Hindi system for India */
  248.  verPakistan = 34,
  249.  verLithuania = 41,
  250.  verPoland = 42,
  251.  verHungary = 43,
  252.  verEstonia = 44,
  253.  verLatvia = 45
  254. };
  255. enum {
  256.  verLapland = 46,
  257.  verFaeroeIsl = 47,
  258.  verIran = 48,
  259.  verRussia = 49,
  260.  verIreland = 50,                /* English-language version for Ireland */
  261.  verKorea = 51,
  262.  verChina = 52,
  263.  verTaiwan = 53,
  264.  verThailand = 54
  265. };
  266.  
  267. #define minCountry verUS
  268. #define maxCountry verThailand
  269.  
  270. /*Obsolete region code names, kept for backward compatibility*/
  271.  
  272. enum {
  273.  verBelgiumLux = 6,                /* (use verFrBelgiumLux instead, less ambiguous) */
  274.  verArabia = 16,
  275.  verYugoslavia = 25,            /* (use verYugoCroatian instead, less ambiguous) */
  276.  verIndia = 33,                    /* (use verIndiaHindi instead, less ambiguous) */
  277.  
  278.  
  279.  
  280. /* Calendar Codes */
  281.  calGregorian = 0,
  282.  calArabicCivil = 1,
  283.  calArabicLunar = 2,
  284.  calJapanese = 3,
  285.  calJewish = 4,
  286.  calCoptic = 5,
  287.  calPersian = 6,
  288.  
  289. /* Integer Format Codes */
  290.  intWestern = 0,
  291.  intArabic = 1,
  292.  intRoman = 2,
  293.  intJapanese = 3,
  294.  intEuropean = 4,
  295.  intOutputMask = 0x8000,
  296.  
  297. /* CharByte byte types */
  298.  smSingleByte = 0,
  299.  smFirstByte = -1,
  300.  smLastByte = 1,
  301.  smMiddleByte = 2,
  302.  
  303. /* CharType field masks */
  304.  smcTypeMask = 0x000F,
  305.  smcReserved = 0x00F0
  306. };
  307. enum {
  308.  smcClassMask = 0x0F00,
  309.  smcOrientationMask = 0x1000,        /*two-byte script glyph orientation*/
  310.  smcRightMask = 0x2000,
  311.  smcUpperMask = 0x4000,
  312.  smcDoubleMask = 0x8000,
  313.  
  314. /* Basic CharType character types */
  315.  smCharPunct = 0x0000,
  316.  smCharAscii = 0x0001,
  317.  smCharEuro = 0x0007,
  318.  smCharExtAscii = 0x0007,            /* More correct synonym for smCharEuro */
  319.  
  320. /* Additional CharType character types for script systems */
  321.  smCharKatakana = 0x0002,            /*Japanese Katakana*/
  322.  smCharHiragana = 0x0003,            /*Japanese Hiragana*/
  323.  smCharIdeographic = 0x0004,        /*Hanzi, Kanji, Hanja*/
  324.  smCharTwoByteGreek = 0x0005,        /*2-byte Greek in Far East systems*/
  325.  smCharTwoByteRussian = 0x0006,        /*2-byte Cyrillic in Far East systems*/
  326.  smCharBidirect = 0x0008,            /*Arabic/Hebrew*/
  327.  smCharContextualLR = 0x0009,        /*Contextual left-right: Thai, Indic scripts*/        /*<58>*/
  328.  smCharNonContextualLR = 0x000A,    /*Non-contextual left-right: Cyrillic, Greek*/        /*<58>*/
  329.  smCharHangul = 0x000C,                /*Korean Hangul*/
  330.  smCharJamo = 0x000D,                /*Korean Jamo*/
  331.  smCharBopomofo = 0x000E,            /*Chinese Bopomofo*/    
  332.     
  333. /* old names for some of above, for backward compatibility */
  334.  smCharFISKana = 0x0002,            /*Katakana*/
  335.  smCharFISGana = 0x0003,            /*Hiragana*/
  336.  smCharFISIdeo = 0x0004                /*Hanzi, Kanji, Hanja*/
  337. };
  338. enum {
  339.  smCharFISGreek = 0x0005,            /*2-byte Greek in Far East systems*/
  340.  smCharFISRussian = 0x0006,            /*2-byte Cyrillic in Far East systems*/
  341.  
  342. /* CharType classes for punctuation (smCharPunct) */
  343.  smPunctNormal = 0x0000,
  344.  smPunctNumber = 0x0100,
  345.  smPunctSymbol = 0x0200,
  346.  smPunctBlank = 0x0300,
  347.  
  348. /* Additional CharType classes for punctuation in two-byte systems */
  349.  smPunctRepeat = 0x0400,            /* repeat marker */
  350.  smPunctGraphic = 0x0500,            /* line graphics */
  351.  
  352. /* CharType Katakana and Hiragana classes for two-byte systems */
  353.  smKanaSmall = 0x0100,                /*small kana character*/
  354.  smKanaHardOK = 0x0200,                /*can have dakuten*/
  355.  smKanaSoftOK = 0x0300,                /*can have dakuten or han-dakuten*/
  356.  
  357. /* CharType Ideographic classes for two-byte systems */
  358.  smIdeographicLevel1 = 0x0000,        /*level 1 char*/
  359.  smIdeographicLevel2 = 0x0100,        /*level 2 char*/
  360.  smIdeographicUser = 0x0200,        /*user char*/
  361.  
  362. /* old names for above, for backward compatibility */
  363.  smFISClassLvl1 = 0x0000,            /*level 1 char*/
  364.  smFISClassLvl2 = 0x0100,            /*level 2 char*/
  365.  smFISClassUser = 0x0200,            /*user char*/
  366.  
  367. /* CharType Jamo classes for Korean systems */
  368.  smJamoJaeum = 0x0000,                /*simple consonant char*/
  369.  smJamoBogJaeum = 0x0100,            /*complex consonant char*/
  370.  smJamoMoeum = 0x0200                /*simple vowel char*/
  371. };
  372. enum {
  373.  smJamoBogMoeum = 0x0300,            /*complex vowel char*/
  374.  
  375. /* CharType glyph orientation for two-byte systems */
  376.  smCharHorizontal = 0x0000,            /* horizontal character form, or for both */
  377.  smCharVertical = 0x1000,            /* vertical character form */
  378.  
  379. /* CharType directions */
  380.  smCharLeft = 0x0000,
  381.  smCharRight = 0x2000,
  382.  
  383. /* CharType case modifers */
  384.  smCharLower = 0x0000,
  385.  smCharUpper = 0x4000,
  386.  
  387. /* CharType character size modifiers (1 or multiple bytes). */
  388.  smChar1byte = 0x0000,
  389.  smChar2byte = 0x8000,
  390.  
  391. /* TransliterateText target types for Roman */
  392.  smTransAscii = 0,                    /*convert to ASCII*/
  393.  smTransNative = 1,                    /*convert to font script*/
  394.  smTransCase = 0xFE,                /*convert case for all text*/
  395.  smTransSystem = 0xFF,                /*convert to system script*/
  396.  
  397. /* TransliterateText target types for two-byte scripts */
  398.  smTransAscii1 = 2,                    /*1-byte Roman*/
  399.  smTransAscii2 = 3,                    /*2-byte Roman*/
  400.  smTransKana1 = 4,                    /*1-byte Japanese Katakana*/
  401.  smTransKana2 = 5                    /*2-byte Japanese Katakana*/
  402. };
  403. enum {
  404.  smTransGana2 = 7,                    /*2-byte Japanese Hiragana (no 1-byte Hiragana)*/
  405.  smTransHangul2 = 8,                /*2-byte Korean Hangul*/
  406.  smTransJamo2 = 9,                    /*2-byte Korean Jamo*/
  407.  smTransBopomofo2 = 10,                /*2-byte Chinese Bopomofo*/
  408.  
  409. /* TransliterateText target modifiers */
  410.  smTransLower = 0x4000,                /*target becomes lowercase*/
  411.  smTransUpper = 0x8000,                /*target becomes uppercase*/
  412.  
  413. /* TransliterateText resource format numbers */
  414.  smTransRuleBaseFormat = 1,            /*Rule based trsl resource format */
  415.  smTransHangulFormat = 2,            /*Table based Hangul trsl resource format*/
  416.  
  417. /* TransliterateText property flags */
  418.  smTransPreDoubleByting = 1,        /*Convert all text to double byte before transliteration*/
  419.  smTransPreLowerCasing = 2,            /*Convert all text to lower case before transliteration*/
  420.   
  421. /* TransliterateText source mask - general */
  422.  smMaskAll = 0xFFFFFFFF,            /*Convert all text*/
  423.  
  424. /* TransliterateText source masks */
  425.  smMaskAscii = 0x00000001,            /*2^smTransAscii*/
  426.  smMaskNative = 0x00000002,            /*2^smTransNative*/
  427.  
  428. /* TransliterateText source masks for two-byte scripts */
  429.  smMaskAscii1 = 0x00000004,            /*2^smTransAscii1*/
  430.  smMaskAscii2 = 0x00000008,            /*2^smTransAscii2*/
  431.  smMaskKana1 = 0x00000010,            /*2^smTransKana1*/
  432.  smMaskKana2 = 0x00000020,            /*2^smTransKana2*/
  433.  smMaskGana2 = 0x00000080,            /*2^smTransGana2*/
  434.  smMaskHangul2 = 0x00000100,        /*2^smTransHangul2*/
  435.  smMaskJamo2 = 0x00000200,            /*2^smTransJamo2*/
  436.  smMaskBopomofo2 = 0x00000400,        /*2^smTransBopomofo2*/
  437.  
  438. /* Result values from GetSMVariable, SetSMVariable, GetScriptVariable and SetScriptVariable calls. */
  439.  smNotInstalled = 0,                /*routine not available in script*/
  440.  smBadVerb = -1,                    /*Bad verb passed to a routine*/
  441.  smBadScript = -2                    /*Bad script code passed to a routine*/
  442. };
  443. enum {
  444.  
  445. /* Values for script redraw flag. */
  446.  smRedrawChar = 0,                    /*Redraw character only*/
  447.  smRedrawWord = 1,                    /*Redraw entire word (2-byte systems)*/
  448.  smRedrawLine = -1,                    /*Redraw entire line (bidirectional systems)*/
  449.  
  450. /* GetSMVariable and SetSMVariable verbs */
  451.  smVersion = 0,                        /*Script Manager version number*/
  452.  smMunged = 2,                        /*Globals change count*/
  453.  smEnabled = 4,                        /*Count of enabled scripts, incl Roman*/
  454.  smBidirect = 6,                    /*At least one bidirectional script*/
  455.  smFontForce = 8,                    /*Force font flag*/
  456.  smIntlForce = 10,                    /*Force intl flag*/
  457.  smForced = 12,                        /*Script was forced to system script*/
  458.  smDefault = 14,                    /*Script was defaulted to Roman script*/
  459.  smPrint = 16,                        /*Printer action routine*/
  460.  smSysScript = 18,                    /*System script*/
  461.  smLastScript = 20,                    /*Last keyboard script*/
  462.  smKeyScript = 22,                    /*Keyboard script*/
  463.  smSysRef = 24,                        /*System folder refNum*/
  464.  smKeyCache = 26,                    /*obsolete*/
  465.  smKeySwap = 28,                    /*Swapping table handle*/
  466.  smGenFlags = 30,                    /*General flags long*/
  467.  smOverride = 32                    /*Script override flags*/
  468. };
  469. enum {
  470.  smCharPortion = 34,                /*Ch vs SpExtra proportion*/
  471.  
  472. /* New for System 7.0: */
  473.  smDoubleByte = 36,                    /*Flag for double-byte script installed*/
  474.  smKCHRCache = 38,                    /*Returns pointer to KCHR cache*/
  475.  smRegionCode = 40,                    /*Returns current region code (verXxx)*/
  476.  smKeyDisableState = 42,            /*Returns current keyboard disable state*/            /*<47>*/
  477.  
  478. /* GetScriptVariable and SetScriptVariable verbs.
  479. Note: Verbs private to script systems are negative, while
  480. those general across script systems are non-negative. */
  481.  smScriptVersion = 0,                /*Script software version*/
  482.  smScriptMunged = 2,                /*Script entry changed count*/
  483.  smScriptEnabled = 4,                /*Script enabled flag*/
  484.  smScriptRight = 6,                    /*Right to left flag*/
  485.  smScriptJust = 8,                    /*Justification flag*/
  486.  smScriptRedraw = 10,                /*Word redraw flag*/
  487.  smScriptSysFond = 12,                /*Preferred system font*/
  488.  smScriptAppFond = 14,                /*Preferred Application font*/
  489.  smScriptBundle = 16,                /*Beginning of itlb verbs*/
  490.  smScriptNumber = 16,                /*Script itl0 id*/
  491.  smScriptDate = 18,                    /*Script itl1 id*/
  492.  smScriptSort = 20,                    /*Script itl2 id*/
  493.  smScriptFlags = 22,                /*flags word*/
  494.  smScriptToken = 24,                /*Script itl4 id*/
  495.  smScriptEncoding = 26,                /*id of optional itl5, if present*/
  496.  smScriptLang = 28                    /*Current language for script*/
  497. };
  498. enum {
  499.  smScriptNumDate = 30,                /*Script Number/Date formats.*/
  500.  smScriptKeys = 32,                    /*Script KCHR id*/
  501.  smScriptIcon = 34,                    /*ID # of SICN or kcs#/kcs4/kcs8 suite*/
  502.  smScriptPrint = 36,                /*Script printer action routine*/
  503.  smScriptTrap = 38,                    /*Trap entry pointer*/
  504.  smScriptCreator = 40,                /*Script file creator*/
  505.  smScriptFile = 42,                    /*Script file name*/
  506.  smScriptName = 44,                    /*Script name*/
  507.  
  508. /* There is a hole here for old Kanji private verbs 46-76 
  509.  
  510.  New for System 7.0: */
  511.  smScriptMonoFondSize = 78,            /*default monospace FOND (hi) & size (lo)*/
  512.  smScriptPrefFondSize = 80,            /*preferred FOND (hi) & size (lo)*/
  513.  smScriptSmallFondSize = 82,        /*default small FOND (hi) & size (lo)*/
  514.  smScriptSysFondSize = 84,            /*default system FOND (hi) & size (lo)*/
  515.  smScriptAppFondSize = 86,            /*default app FOND (hi) & size (lo)*/
  516.  smScriptHelpFondSize = 88,            /*default Help Mgr FOND (hi) & size (lo)*/
  517.  smScriptValidStyles = 90,            /*mask of valid styles for script*/
  518.  smScriptAliasStyle = 92,            /*style (set) to use for aliases*/
  519.  
  520. /* Special script code values for International Utilities */
  521.  iuSystemScript = -1,                /* <obsolete>  system script */
  522.  iuCurrentScript = -2,                /* <obsolete>  current script (for font of grafPort) */
  523.  
  524. /* Negative verbs for KeyScript */
  525.  smKeyNextScript = -1,                /* Switch to next available script */
  526.  smKeySysScript = -2,                /* Switch to the system script */
  527.  smKeySwapScript = -3,                /* Switch to previously-used script */
  528.  
  529. /* New for System 7.0: */
  530.  smKeyNextKybd = -4                    /* Switch to next keyboard in current keyscript */
  531. };
  532. enum {
  533.  smKeySwapKybd = -5,                /* Switch to previously-used keyboard in current keyscript */
  534.  
  535.  smKeyDisableKybds = -6,            /* Disable keyboards not in system or Roman script */
  536.  smKeyEnableKybds = -7,                /* Re-enable keyboards for all enabled scripts */
  537.  smKeyToggleInline = -8,            /* Toggle inline input for current keyscript */
  538.  smKeyToggleDirection = -9,            /* Toggle default line direction (TESysJust) */
  539.  smKeyNextInputMethod = -10,        /* Switch to next input method in current keyscript */
  540.  smKeySwapInputMethod = -11,        /* Switch to last-used input method in current keyscript */
  541.  
  542.  smKeyDisableKybdSwitch = -12,        /* Disable switching from the current keyboard */
  543.  
  544. smKeySetDirLeftRight = -15,            /* Set default line dir to left-right, align left */    /*<43>*/
  545. smKeySetDirRightLeft = -16,            /* Set default line dir to right-left, align right */    /*<43>*/
  546. smKeyRoman = -17,                    /* Set keyscript to Roman. Does nothing if Roman-only
  547.                                         system, unlike KeyScript(smRoman) which forces
  548.                                         an update to current default Roman keyboard */        /*<55>*/
  549.  
  550.  
  551. /* Bits in the smScriptFlags word
  552. (bits above 8 are non-static) */
  553.  smsfIntellCP = 0,                    /*Script has intelligent cut & paste*/
  554.  smsfSingByte = 1,                    /*Script has only single bytes*/
  555.  smsfNatCase = 2,                    /*Native chars have upper & lower case*/
  556.  smsfContext = 3,                    /*Script is contextual*/
  557.  smsfNoForceFont = 4,                /*Script will not force characters*/
  558.  smsfB0Digits = 5,                    /*Script has alternate digits at B0-B9*/
  559.  smsfAutoInit = 6,                    /*Auto initialize the script*/
  560.  smsfUnivExt = 7,                    /*Script is handled by universal extension*/            /*<43>*/
  561.  smsfSynchUnstyledTE = 8,            /*Script synchronizes for unstyled TE*/
  562.  smsfForms = 13,                    /*Uses contextual forms for letters*/
  563.  smsfLigatures = 14,                /*Uses contextual ligatures*/
  564.  smsfReverse = 15,                    /*Reverses native text, right-left*/
  565.  
  566. /* Bits in the smGenFlags long.
  567. First (high-order) byte is set from itlc flags byte. */
  568.  smfShowIcon = 31,                    /*Show icon even if only one script*/
  569.  smfDualCaret = 30,                    /*Use dual caret for mixed direction text*/
  570.  smfNameTagEnab = 29,                /*Reserved for internal use*/
  571.  smfUseAssocFontInfo = 28            /*Use the associated font info for FontMetrics calls */    /*<48>*/
  572.  
  573. };
  574. enum {
  575.  
  576. /* Roman script constants 
  577.  
  578.  The following are here for backward compatibility, but should not be used. 
  579.  This information should be obtained using GetScript. */
  580.  romanSysFond = 0x3FFF,                /*system font id number*/
  581.  romanAppFond = 3,                    /*application font id number*/
  582.  romanFlags = 0x0007,                /*roman settings*/
  583.  
  584. /* Script Manager font equates. */
  585.  smFondStart = 0x4000,                /*start from 16K*/
  586.  smFondEnd = 0xC000,                /*past end of range at 48K*/
  587.  
  588. /* Miscellaneous font equates. */
  589.  smUprHalfCharSet = 0x80,            /*first char code in top half of std char set*/
  590.  
  591. /* Character Set Extensions */
  592.  diaeresisUprY = 0xD9,
  593.  fraction = 0xDA,
  594.  intlCurrency = 0xDB,
  595.  leftSingGuillemet = 0xDC,
  596.  rightSingGuillemet = 0xDD,
  597.  fiLigature = 0xDE,
  598.  flLigature = 0xDF,
  599.  dblDagger = 0xE0,
  600.  centeredDot = 0xE1,
  601.  baseSingQuote = 0xE2,
  602.  baseDblQuote = 0xE3,
  603.  perThousand = 0xE4,
  604.  circumflexUprA = 0xE5
  605. };
  606. enum {
  607.  circumflexUprE = 0xE6,
  608.  acuteUprA = 0xE7,
  609.  diaeresisUprE = 0xE8,
  610.  graveUprE = 0xE9,
  611.  acuteUprI = 0xEA,
  612.  circumflexUprI = 0xEB,
  613.  diaeresisUprI = 0xEC,
  614.  graveUprI = 0xED,
  615.  acuteUprO = 0xEE,
  616.  circumflexUprO = 0xEF,
  617.  appleLogo = 0xF0,
  618.  graveUprO = 0xF1,
  619.  acuteUprU = 0xF2,
  620.  circumflexUprU = 0xF3,
  621.  graveUprU = 0xF4,
  622.  dotlessLwrI = 0xF5,
  623.  circumflex = 0xF6,
  624.  tilde = 0xF7,
  625.  macron = 0xF8,
  626.  breveMark = 0xF9
  627. };
  628. enum {
  629.  overDot = 0xFA,
  630.  ringMark = 0xFB,
  631.  cedilla = 0xFC,
  632.  doubleAcute = 0xFD,
  633.  ogonek = 0xFE,
  634.  hachek = 0xFF,
  635.  
  636.  
  637. /* TokenType values */
  638.  tokenIntl = 4,                        /*the itl resource number of the tokenizer*/
  639.  tokenEmpty = -1                    /*used internally as an empty flag*/
  640. };
  641. enum {
  642.  tokenUnknown = 0,                    /*chars that do not match a defined token type*/
  643.  tokenWhite = 1,                    /*white space*/
  644.  tokenLeftLit = 2,                    /*literal begin*/
  645.  tokenRightLit = 3,                    /*literal end*/
  646.  tokenAlpha = 4,                    /*alphabetic*/
  647.  tokenNumeric = 5,                    /*numeric*/
  648.  tokenNewLine = 6,                    /*new line*/
  649.  tokenLeftComment = 7,                /*open comment*/
  650.  tokenRightComment = 8,                /*close comment*/
  651.  tokenLiteral = 9,                    /*literal*/
  652.  tokenEscape = 10,                    /*character escape (e.g. '\' in "\n", "\t")*/
  653.  tokenAltNum = 11,                    /*alternate number (e.g. $B0-B9 in Arabic,Hebrew)*/
  654.  tokenRealNum = 12,                    /*real number*/
  655.  tokenAltReal = 13,                    /*alternate real number*/
  656.  tokenReserve1 = 14,                /*reserved*/
  657.  tokenReserve2 = 15,                /*reserved*/
  658.  tokenLeftParen = 16,                /*open parenthesis*/
  659.  tokenRightParen = 17,                /*close parenthesis*/
  660.  tokenLeftBracket = 18,                /*open square bracket*/
  661.  tokenRightBracket = 19                /*close square bracket*/
  662. };
  663. enum {
  664.  tokenLeftCurly = 20,                /*open curly bracket*/
  665.  tokenRightCurly = 21,                /*close curly bracket*/
  666.  tokenLeftEnclose = 22,                /*open guillemet*/
  667.  tokenRightEnclose = 23,            /*close guillemet*/
  668.  tokenPlus = 24,
  669.  tokenMinus = 25,
  670.  tokenAsterisk = 26,                /*times/multiply*/
  671.  tokenDivide = 27,
  672.  tokenPlusMinus = 28,                /*plus or minus symbol*/
  673.  tokenSlash = 29,
  674.  tokenBackSlash = 30,
  675.  tokenLess = 31,                    /*less than symbol*/
  676.  tokenGreat = 32,                    /*greater than symbol*/
  677.  tokenEqual = 33,
  678.  tokenLessEqual2 = 34,                /*less than or equal, 2 characters (e.g. <=)*/
  679.  tokenLessEqual1 = 35,                /*less than or equal, 1 character*/
  680.  tokenGreatEqual2 = 36,                /*greater than or equal, 2 characters (e.g. >=)*/
  681.  tokenGreatEqual1 = 37,                /*greater than or equal, 1 character*/
  682.  token2Equal = 38,                    /*double equal (e.g. ==)*/
  683.  tokenColonEqual = 39                /*colon equal*/
  684. };
  685. enum {
  686.  tokenNotEqual = 40,                /*not equal, 1 character*/
  687.  tokenLessGreat = 41,                /*less/greater, Pascal not equal (e.g. <>)*/
  688.  tokenExclamEqual = 42,                /*exclamation equal, C not equal (e.g. !=)*/
  689.  tokenExclam = 43,                    /*exclamation point*/
  690.  tokenTilde = 44,                    /*centered tilde*/
  691.  tokenComma = 45,
  692.  tokenPeriod = 46,
  693.  tokenLeft2Quote = 47,                /*open double quote*/
  694.  tokenRight2Quote = 48,                /*close double quote*/
  695.  tokenLeft1Quote = 49,                /*open single quote*/
  696.  tokenRight1Quote = 50,                /*close single quote*/
  697.  token2Quote = 51,                    /*double quote*/
  698.  token1Quote = 52,                    /*single quote*/
  699.  tokenSemicolon = 53,
  700.  tokenPercent = 54,
  701.  tokenCaret = 55,
  702.  tokenUnderline = 56,
  703.  tokenAmpersand = 57,
  704.  tokenAtSign = 58,
  705.  tokenBar = 59                        /*vertical bar*/
  706. };
  707. enum {
  708.  tokenQuestion = 60,
  709.  tokenPi = 61,                        /*lower-case pi*/
  710.  tokenRoot = 62,                    /*square root symbol*/
  711.  tokenSigma = 63,                    /*capital sigma*/
  712.  tokenIntegral = 64,                /*integral sign*/
  713.  tokenMicro = 65,
  714.  tokenCapPi = 66,                    /*capital pi*/
  715.  tokenInfinity = 67,
  716.  tokenColon = 68,
  717.  tokenHash = 69,                    /*e.g. #*/
  718.  tokenDollar = 70,
  719.  tokenNoBreakSpace = 71,            /*non-breaking space*/
  720.  tokenFraction = 72,
  721.  tokenIntlCurrency = 73,
  722.  tokenLeftSingGuillemet = 74,
  723.  tokenRightSingGuillemet = 75,
  724.  tokenPerThousand = 76,
  725.  tokenEllipsis = 77,
  726.  tokenCenterDot = 78,
  727.  tokenNil = 127
  728. };
  729. enum {
  730.  delimPad = -2,
  731.  
  732. /* obsolete, misspelled token names kept for backward compatibility */
  733.  tokenTilda = 44,
  734.  tokenCarat = 55
  735.  
  736. };
  737.  
  738. enum {
  739. /* Table selectors for GetItlTable */
  740.  smWordSelectTable = 0,            /* get word select break table from 'itl2' */
  741.  smWordWrapTable = 1,            /* get word wrap break table from 'itl2' */
  742.  smNumberPartsTable = 2,        /* get default number parts table from 'itl4' */
  743.  smUnTokenTable = 3,            /* get unToken table from 'itl4' */
  744.  smWhiteSpaceList = 4,            /* get white space list from 'itl4' */
  745.  
  746.  iuWordSelectTable = 0,            /* <obsolete>  get word select break table from 'itl2' */
  747.  iuWordWrapTable = 1,            /* <obsolete>  get word wrap break table from 'itl2' */
  748.  iuNumberPartsTable = 2,        /* <obsolete>  get default number parts table from 'itl4' */
  749.  iuUnTokenTable = 3,            /* <obsolete>  get unToken table from 'itl4' */
  750.  iuWhiteSpaceList = 4            /* <obsolete>  get white space list from 'itl4' */
  751. };
  752.  
  753. /* end of stuff moved from Packages.h */
  754.  
  755. enum {tokenOK,tokenOverflow,stringOverflow,badDelim,badEnding,crash};
  756. typedef unsigned char TokenResults;
  757.  
  758.  
  759. typedef char CharByteTable[256];
  760.  
  761.  
  762. typedef short TokenType;
  763. typedef TokenType DelimType[2];
  764. typedef TokenType CommentType[4];
  765.  
  766. struct TokenRec {
  767.  TokenType theToken;
  768.  Ptr position;                        /*pointer into original source*/
  769.  long length;                        /*length of text in original source*/
  770.  StringPtr stringPosition;            /*Pascal/C string copy of identifier*/
  771. };
  772.  
  773. typedef struct TokenRec TokenRec;
  774. typedef TokenRec *TokenRecPtr;
  775.  
  776. struct TokenBlock {
  777.  Ptr source;                        /*pointer to stream of characters*/
  778.  long sourceLength;                    /*length of source stream*/
  779.  Ptr tokenList;                        /*pointer to array of tokens*/
  780.  long tokenLength;                    /*maximum length of TokenList*/
  781.  long tokenCount;                    /*number tokens generated by tokenizer*/
  782.  Ptr stringList;                    /*pointer to stream of identifiers*/
  783.  long stringLength;                    /*length of string list*/
  784.  long stringCount;                    /*number of bytes currently used*/
  785.  Boolean doString;                    /*make strings & put into StringList*/
  786.  Boolean doAppend;                    /*append to TokenList rather than replace*/
  787.  Boolean doAlphanumeric;            /*identifiers may include numeric*/
  788.  Boolean doNest;                    /*do comments nest?*/
  789.  TokenType leftDelims[2];
  790.  TokenType rightDelims[2];
  791.  TokenType leftComment[4];
  792.  TokenType rightComment[4];
  793.  TokenType escapeCode;                /*escape symbol code*/
  794.  TokenType decimalCode;
  795.  Handle itlResource;                /*handle to itl4 resource of current script*/
  796.  long reserved[8];                    /*must be zero!*/
  797. };
  798.  
  799. typedef struct TokenBlock TokenBlock;
  800. typedef TokenBlock *TokenBlockPtr;
  801.  
  802. #ifdef __cplusplus
  803. extern "C" {
  804. #endif
  805. pascal short FontScript(void)
  806.  = {0x2F3C,0x8200,0x0000,0xA8B5}; 
  807. pascal short IntlScript(void)
  808.  = {0x2F3C,0x8200,0x0002,0xA8B5}; 
  809. pascal void KeyScript(short code)
  810.  = {0x2F3C,0x8002,0x0004,0xA8B5}; 
  811. pascal short CharByte(Ptr textBuf,short textOffset)
  812.  = {0x2F3C,0x8206,0x0010,0xA8B5}; 
  813. pascal short CharType(Ptr textBuf,short textOffset)
  814.  = {0x2F3C,0x8206,0x0012,0xA8B5}; 
  815. pascal OSErr Transliterate(Handle srcHandle,Handle dstHandle,short target,
  816.  long srcMask)
  817.  = {0x2F3C,0x820E,0x0018,0xA8B5}; 
  818. pascal Boolean ParseTable(CharByteTable table)
  819.  = {0x2F3C,0x8204,0x0022,0xA8B5}; 
  820. #define GetSysDirection() (* (short*) 0x0BAC)
  821. #define GetSysJust() (* (short*) 0x0BAC)
  822. pascal void SetSysDirection(short newDirection)
  823.  = {0x31DF,0x0BAC}; 
  824. pascal void SetSysJust(short newJust)
  825.  = {0x31DF,0x0BAC}; 
  826.  
  827. pascal TokenResults IntlTokenize(TokenBlockPtr tokenParam)
  828.  = {0x2F3C,0x8204,0xFFFA,0xA8B5}; 
  829.  
  830.  
  831. pascal short FontToScript(short fontNumber)
  832.  = {0x2F3C,0x8202,0x0006,0xA8B5}; 
  833. pascal short Font2Script(short fontNumber)
  834.  = {0x2F3C,0x8202,0x0006,0xA8B5}; 
  835. pascal long GetSMVariable(short selector)
  836.  = {0x2F3C,0x8402,0x0008,0xA8B5}; 
  837. pascal long GetEnvirons(short verb)
  838.  = {0x2F3C,0x8402,0x0008,0xA8B5}; 
  839. pascal OSErr SetSMVariable(short selector,long param)
  840.  = {0x2F3C,0x8206,0x000A,0xA8B5}; 
  841. pascal OSErr SetEnvirons(short verb,long param)
  842.  = {0x2F3C,0x8206,0x000A,0xA8B5}; 
  843. pascal long GetScriptVariable(short script,short selector)
  844.  = {0x2F3C,0x8404,0x000C,0xA8B5}; 
  845. pascal long GetScript(short script,short verb)
  846.  = {0x2F3C,0x8404,0x000C,0xA8B5}; 
  847. pascal OSErr SetScriptVariable(short script,short selector,long param)
  848.  = {0x2F3C,0x8208,0x000E,0xA8B5}; 
  849. pascal OSErr SetScript(short script,short verb,long param)
  850.  = {0x2F3C,0x8208,0x000E,0xA8B5}; 
  851.  
  852.  
  853.  
  854. /*  New for 7.1  */                                                                    /*<46>*/
  855.  
  856. pascal Ptr GetScriptUtilityAddress(short selector,Boolean Before,ScriptCode script)
  857.     = {0x2F3C,0xC404,0x0038,0xA8B5}; 
  858.  
  859. pascal void SetScriptUtilityAddress(short selector,Boolean Before,Ptr routineAddr,ScriptCode script)
  860.     = {0x2F3C,0xC008,0x003A,0xA8B5}; 
  861.  
  862. pascal Ptr GetScriptQDPatchAddress(short trapNum,Boolean Before,Boolean forPrinting,ScriptCode script)
  863.     = {0x2F3C,0xC406,0x003C,0xA8B5}; 
  864.  
  865. pascal void SetScriptQDPatchAddress(short trapNum,Boolean Before,Boolean forPrinting,Ptr routineAddr,ScriptCode script)
  866.     = {0x2F3C,0xC00A,0x003E,0xA8B5}; 
  867.  
  868.  
  869.  
  870. pascal short CharacterByteType(Ptr textBuf,short textOffset,ScriptCode script)                /*<60>*/
  871.  = {0x2F3C,0xC206,0x0010,0xA8B5}; 
  872.  
  873. pascal short CharacterType(Ptr textBuf,short textOffset,ScriptCode script)                /*<60>*/
  874.  = {0x2F3C,0xC206,0x0012,0xA8B5}; 
  875.  
  876. pascal OSErr TransliterateText(Handle srcHandle,Handle dstHandle,short target,
  877.  long srcMask,ScriptCode script)                                                    /*<60>*/
  878.  = {0x2F3C,0xC20E,0x0018,0xA8B5}; 
  879.  
  880. pascal Boolean FillParseTable(CharByteTable table,ScriptCode script)                    /*<60>*/
  881.  = {0x2F3C,0xC204,0x0022,0xA8B5}; 
  882.  
  883. /* moved from Packages.h */
  884.  
  885. pascal Handle GetIntlResource(short theID)
  886.  = {0x3F3C,0x0006,0xA9ED}; 
  887. pascal Handle IUGetIntl(short theID)        /* obsolete name */
  888.  = {0x3F3C,0x0006,0xA9ED}; 
  889. pascal void IUSetIntl(short refNum,short theID,Handle intlHandle)        /* obsolete name */
  890.  = {0x3F3C,0x0008,0xA9ED}; 
  891. pascal void ClearIntlResourceCache(void)
  892.  = {0x3F3C,0x0018,0xA9ED}; 
  893. pascal void IUClearCache(void)        /* obsolete name */
  894.  = {0x3F3C,0x0018,0xA9ED}; 
  895.  
  896. pascal void GetIntlResourceTable(ScriptCode script,short tableCode,Handle *itlHandle,
  897.  long *offset,long *length)
  898.  = {0x3F3C,0x0024,0xA9ED}; 
  899. pascal void IUGetItlTable(ScriptCode script,short tableCode,Handle *itlHandle,        /* obsolete name */
  900.  long *offset,long *length)
  901.  = {0x3F3C,0x0024,0xA9ED}; 
  902.  
  903.  
  904.  
  905. #ifdef __cplusplus
  906. }
  907. #endif
  908.  
  909. #endif
  910.